﻿<mba:BaseBAWindow x:Class="GlobalParamsUI.MainWindow"
				  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
				  xmlns:mba="clr-namespace:WixWPF;assembly=WixWPF"
				  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
				  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
				  Title="GlobalParamsUI Installer"
				  Height="200" Width="400" ResizeMode="NoResize"
				  mc:Ignorable="d" >
	<Window.Resources>
		<mba:ConvertBoolToVisibility x:Key="BoolToVis" />
		<mba:ConvertBoolToVisibility x:Key="BoolToVisNeg" TrueValue="Collapsed" FalseValue="Visible" />
	</Window.Resources>
	<Grid x:Name="LayoutRoot" >
		<Grid.RowDefinitions>
			<RowDefinition Height="20" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="20" />
		</Grid.RowDefinitions>
		<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
			<Image Grid.Row="1" MaxHeight="50" Source="/GlobalParamsUI;component/Logo.png" Stretch="Uniform" />
			<TextBlock Grid.Row="1" Text="GlobalParamsUI" Margin="10,0,0,0" FontSize="24" VerticalAlignment="Center" />
		</StackPanel>
		<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center" >
			<StackPanel.Resources>
				<Style TargetType="Button">
					<Setter Property="Margin" Value="6,0" />
					<Setter Property="Padding" Value="4,2" />
				</Style>
			</StackPanel.Resources>
			<Button x:Name="ButtonInstall" Content="Install" IsEnabled="{Binding CanInstall}" Click="OnButtonClick" />
			<Button x:Name="ButtonUninstall" Content="Uninstall" IsEnabled="{Binding IsInstalled}" Click="OnButtonClick" />
			<Button x:Name="ButtonQuit" Content="Quit" Click="OnButtonClick" />
		</StackPanel>
		<Canvas Grid.Row="0" Grid.RowSpan="6" Visibility="{Binding IsBusy, Converter={StaticResource BoolToVis}}" >
			<Border Canvas.Left="0" Canvas.Top="0" Height="{Binding ElementName=LayoutRoot, Path=ActualHeight}" Width="{Binding ElementName=LayoutRoot, Path=ActualWidth}" Background="Black" Opacity="0.75" />
			<Grid Canvas.Left="0" Canvas.Top="0" Height="{Binding ElementName=LayoutRoot, Path=ActualHeight}" Width="{Binding ElementName=LayoutRoot, Path=ActualWidth}" >
				<TextBlock Text="{Binding Message}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,15,0,0" />
				<ProgressBar IsIndeterminate="True" Height="10" Margin="0,55,0,0" />
			</Grid>
		</Canvas>
	</Grid>
</mba:BaseBAWindow>